<?php
namespace common\utils;
/**
	redis
 */
class Redis
{
	const HOST = '127.0.0.1';
	const HOST_PORT = 6379;

	public static $_instance = null; //静态实例
	public function __construct()
	{
		self::$_instance = new \Redis();
        self::$_instance->connect(self::HOST, self::HOST_PORT);
	}

	//获取静态实例
    public static function getRedis()
    {
        if(!self::$_instance){
            new self;
        }
        return self::$_instance;
    }

    private function __clone(){}

}